function _get(value: number | string | undefined, list: any[]) {
  if (value !== undefined) {
    const tmp = list.find((x: any) => {
      return x.value === value
    })
    if (tmp) return tmp.label
    return ''
  } else {
    return list
  }
}

// 数据项的状态
export function dataItemStatus(value: string | undefined = undefined) {
  const list = [
    { label: '已发布', value: 'published' },
    { label: '下线', value: 'offline' }
  ]
  return _get(value, list)
}

// 数据项信息-筛选
export function dataItemSettingType(value: string | undefined = undefined) {
  const list = [
    { label: '聚合筛选', value: 'polymerize' },
    { label: '区域筛选', value: 'pca' },
    { label: '园区筛选', value: 'park' },
    { label: '时间筛选(年月日时分秒)', value: 'time' },
    { label: '时间筛选(年月日)', value: 'date' },
    { label: '产业筛选', value: 'industry' },
    { label: '国民经济分类筛选', value: 'national_economy_classification' },
    { label: '战新产业筛选', value: 'strategic_industry' },
    { label: '资质筛选', value: 'qualification' },
    { label: '数值范围筛选', value: 'number_range' },
    { label: '是否条件筛选', value: 'true_or_false' }
  ]
  return _get(value, list)
}

// 平台
export function allPlatform(value: string | undefined = undefined) {
  const list = [
    { label: '产业数观', value: '产业数观' },
    { label: '产业预警通', value: '产业预警通' },
    { label: '金融服务端', value: '金融服务端' },
    { label: '企业服务端', value: '企业服务端' }
  ]
  return _get(value, list)
}

// 榜单级别
export function rankTypeList(value: string | undefined = undefined) {
  const list = [
    { label: '世界级', value: '世界级' },
    { label: '国家级', value: '国家级' },
    { label: '省级', value: '省级' },
    { label: '市级', value: '市级' }
  ]
  return _get(value, list)
}

// 资质级别
export function QualificationTypeList(value: string | undefined = undefined) {
  const list = [
    { label: '世界级', value: '世界级' },
    { label: '国家级', value: '国家级' },
    { label: '省级', value: '省级' },
    { label: '市级', value: '市级' },
    { label: '区县级', value: '区县级' }
  ]
  return _get(value, list)
}
